#include <bits/stdc++.h>


/**
 * 时间复杂度：O(n^(3/2))
 * 空间复杂度：O(1)
 * 
 * 方程的解
 * 
 */
using namespace std;
int main() {
    int n;
    cin >> n;
    for (int i = 1; i * i <= n; i++) {
        for (int j = i + 1; j * j <= n; j++) {
            for (int k = j + 1; k * k <= n; k++) {
                if (i * i + j * j + k * k == n) {
                    cout << i << " " << j << " " << k << endl;
                }
            }
        }
    }
    return 0;
}